package com.fanco.learn_datastruct_leetcode.reflection.proxy_jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class SomeInvocationHandler implements InvocationHandler {

    private SomeService service;

    public SomeInvocationHandler(SomeService service) {
        this.service = service;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("------begin-----");
        Object invoke = method.invoke(service, args);
        System.out.println("------end-------");
        return invoke;
    }
}
